# Maintainer: Maxim Baz <archlinux at maximbaz dot com>

_id=browserpass@maximbaz.com
pkgname=browserpass-firefox
pkgver=3.8.0
pkgrel=1
pkgdesc="Firefox extension for Browserpass, browser extension for zx2c4's pass (password manager)"
arch=('any')
url="https://github.com/browserpass/browserpass-extension"
license=('ISC')
groups=('firefox-addons')
depends=('browserpass')
source=("${pkgname}-${pkgver}.xpi::https://addons.mozilla.org/firefox/downloads/file/4187654/browserpass_ce-${pkgver}.xpi"
        "https://raw.githubusercontent.com/browserpass/browserpass-extension/master/LICENSE")
noextract=("${pkgname}-${pkgver}.xpi")
b2sums=('cb03f212d32a06a12e663add29e50acc8348e375e31dcbcbb1be1252a01f892ee6a0261e1ca29fe54aa45112de44f3583a03b1ea81bea30b5a1ac22c238c653c'
        '9e54d91167393d3f3159c3598aa729434c1e7d8ef39083aa40ba6241c9b4b560c64bac1af43efa7be2dac72d8c35413b057b9f67eb41934e10bd8c733437e407')

package() {
    install -Dm644 "${pkgname}-${pkgver}.xpi" "${pkgdir}/usr/lib/firefox/browser/extensions/${_id}.xpi"

    # Install host json from browserpass package
    install -dm755 "${pkgdir}/usr/lib/mozilla/native-messaging-hosts/"
    ln -sf "/usr/lib/browserpass/hosts/firefox/com.github.browserpass.native.json" "${pkgdir}/usr/lib/mozilla/native-messaging-hosts/"

    install -Dm644 -t "${pkgdir}/usr/share/licenses/${pkgname}/" LICENSE
}

# vim:set ts=4 sw=4 et:
